import React, {Component} from "react"
import {View,Text,StyleSheet,ScrollView} from "react-native";
import {connect} from "react-redux";
import Header,{HeaderProps,HEADER_HEIGHT} from "../Components/Header"
import {SCREEN_HEIGHT} from "../../static/js/tools";

/**
 * @Author Training
 * @Desc 包含了顶部标题的一个内容框组件
 * @Params Props
 */

class Content extends Component<HeaderProps>{
    static defaultProps = {
        title:"标题"
    };
    constructor(props: HeaderProps | Readonly<HeaderProps>){
        super(props);

    }

    render():any{
        let {title} = this.props;
        return (
            <View>
                <Header title={title}/>
                <ScrollView style={styles.scroll}>
                    {this.props.children}
                </ScrollView>
            </View>
        );
    }
}

const styles = StyleSheet.create({
    scroll:{
        height: SCREEN_HEIGHT - 120,
        backgroundColor:"white"
    }
})
const mapStateToProps = (state:any) => ({

});
const mapDispatchToProps = (dispatch:any) => ({

});
export default connect(mapStateToProps,mapDispatchToProps)(Content)
